class History
attr_accessor :index,:entered
 def initialize()
   @index = 0
   @entered = [""]
 end
 def get_prev
  if @index == 0
 
  else
    @index = @index - 1
  end
  return @entered[@index]
 end
 def get_next
  if @index >= @entered.length-1
    @index = @entered.length - 1
  else
    @index = @index + 1
  end
  return @entered[@index]
 end
 def enter(s)
   if @entered.length == 1 and @entered.last == ""
     @entered = []
   end
   @entered << s unless @entered.last == s
   @index = @entered.length
 end
end